package chapter12

/**
  * @Copyright: Shanghai Definesys Company.All rights reserved.
  * @Description:
  * @author: chuhaitao
  * @since: 2019/1/18 22:25
  * @history:
  *          1.2019/1/18 created by chuhaitao
  */
object MatchTuple {
  def main(args: Array[String]): Unit = {
    for (list <- Array((0,1), (0, 12, 3), (7, 1), (0, 0))) {

      var result = list match {
        case (0,_) => 0
        case (x,0) => x
        case (x,y) => x + "="+y
        case _ =>  "other"
      }
      println(result)
    }
  }

}
